| Fully Qualified Name: | CodeIgniter\Database\SQLite3\Table |
Class Table
Provides missing features for altering tables that are common in other supported databases, but are missing from SQLite. These are needed in order to support migrations during testing when another database is used as the primary engine, but SQLite in memory databases are used for faster test execution.
| Name | Description | Defined By |
|---|---|---|
| __construct() | Table constructor. | Table |
| dropColumn() | Drops columns from the table. | Table |
| dropForeignKey() | Drops a foreign key from this table so that it won't be recreated in the future. | Table |
| fromTable() | Reads an existing database table and collects all of the information needed to recreate this table. | Table |
| modifyColumn() | Modifies a field, including changing data type, renaming, etc. | Table |
| run() | Called after `fromTable` and any actions, like `dropColumn`, etc, to finalize the action. It creates a temp table, creates the new table with modifications, and copies the data over to the new table. | Table |
Table constructor.
| Parameter Name | Type | Description |
|---|---|---|
| $db | \Connection | |
| $forge | \Forge |
Returns:
Drops columns from the table.
| Parameter Name | Type | Description |
|---|---|---|
| $columns | string|array |
Returns: \CodeIgniter\Database\SQLite3\Table
Drops a foreign key from this table so that it won't be recreated in the future.
| Parameter Name | Type | Description |
|---|---|---|
| $column | string |
Returns: \CodeIgniter\Database\SQLite3\Table
Reads an existing database table and collects all of the information needed to recreate this table.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string |
Returns: \CodeIgniter\Database\SQLite3\Table
Modifies a field, including changing data type, renaming, etc.
| Parameter Name | Type | Description |
|---|---|---|
| $field | array |
Returns: \CodeIgniter\Database\SQLite3\Table
Called after `fromTable` and any actions, like `dropColumn`, etc, to finalize the action. It creates a temp table, creates the new table with modifications, and copies the data over to the new table.
Returns: bool